<form id="config-form" class="edit-form form-horizontal" role="form" data-toggle="validator" method="POST" action="configs/edit">
    <div class="alert alert-info-light" style="margin-bottom:10px;">
        <b>温馨提示</b><br>
		修改配置后，需重新进入小程序端才会生效
       <!-- 2、小程序的AppID和AppSecret请在微信公众平台获取<br>-->
    </div>

    <div class="panel panel-default panel-intro">
        <div class="panel-heading">
            <ul class="nav nav-tabs nav-group">
                <li class="active"><a href="#all" data-toggle="tab">全部</a></li>
				<li><a href="#base" data-toggle="tab">基础配置</a></li>
				<li class="pull-right"><a href="{:url('configs/plugin?name=withdraw')}" title="提现配置" class="dialogit">提现配置</a></li>
<!--				<li><a href="#order" data-toggle="tab">订单配置</a></li>-->
<!--				<li class="pull-right"><a href="{:url('mall/configs/plugin?name=kdniao')}" title="快递鸟配置" class="dialogit">快递鸟配置</a></li>-->
<!--				<li><a href="#kuaidi" data-toggle="tab">快递配置</a></li>-->


<!--				<li class="pull-right"><a href="{:url('shop/config/plugin?name=epay')}" title="支付配置" class="dialogit">支付配置</a></li>-->
<!--				<li class="pull-right"><a href="{:url('vppz/config/plugin?name=address')}" title="地图配置" class="dialogit">地图配置</a></li>-->
            </ul>
        </div>

        <div class="panel-body">
            <div id="myTabContent" class="tab-content">
                <div class="tab-pane fade active in" id="one">
                    <table class="table table-striped table-config">
                        <tbody>
							<!--基础配置-->
							<tr data-type="base">
								<td width="15%">应用名称</td>
								<td>
									<div class="row">
										<div class="col-sm-8 col-xs-12">
											<div><input type="text" name="row[sitename]" value="{$datas.config['sitename']}" class="form-control" data-rule="required" data-tip="请填写应用名称"/></div>
										</div>
										<div class="col-sm-4"></div>
									</div>
								</td>
							</tr>
							<tr data-type="base">
								<td width="15%">微信小程序appid</td>
								<td>
									<div class="row">
										<div class="col-sm-8 col-xs-12">
											<div><input type="text" name="row[mini_app_id]" value="{$datas.config['mini_app_id']}" class="form-control" data-rule="required" data-tip="请填写应用名称"/></div>
										</div>
										<div class="col-sm-4"></div>
									</div>
								</td>
							</tr>
							<tr data-type="base">
								<td width="15%">微信小程序秘钥</td>
								<td>
									<div class="row">
										<div class="col-sm-8 col-xs-12">
											<div><input type="text" name="row[mini_app_secret]" value="{$datas.config['mini_app_secret']}" class="form-control" data-rule="required" data-tip="请填写应用名称"/></div>
										</div>
										<div class="col-sm-4"></div>
									</div>
								</td>
							</tr>

							<tr data-type="base">
								<td width="15%">客服二维码</td>
								<td>
									<div class="row">
										<div class="col-xs-12 col-sm-8">
											<div class="input-group">
												<input id="c-kefu_qrcode" data-rule="" class="form-control" size="50" name="row[kefu_qrcode]" type="text" value="{$datas.config['kefu_qrcode']}">
												<div class="input-group-addon no-border no-padding">
													<span><button type="button" id="faupload-kefu_qrcode" class="btn btn-danger faupload" data-input-id="c-kefu_qrcode" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-kefu_qrcode"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
													<span><button type="button" id="fachoose-kefu_qrcode" class="btn btn-primary fachoose" data-input-id="c-kefu_qrcode" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
												</div>
												<span class="msg-box n-right" for="c-kefu_qrcode"></span>
											</div>
											<ul class="row list-inline faupload-preview" id="p-kefu_qrcode"></ul>
										</div>
										<div class="col-sm-4"></div>
									</div>
								</td>
							</tr>

							<tr data-type="base">
								<td width="15%">微信公众号二维码</td>
								<td>
									<div class="row">
										<div class="col-xs-12 col-sm-8">
											<div class="input-group">
												<input id="c-wechat_account_qrcode" data-rule="" class="form-control" size="50" name="row[wechat_account_qrcode]" type="text" value="{$datas.config['wechat_account_qrcode']}">
												<div class="input-group-addon no-border no-padding">
													<span><button type="button" id="faupload-wechat_account_qrcode" class="btn btn-danger faupload" data-input-id="c-wechat_account_qrcode" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-wechat_account_qrcode"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
													<span><button type="button" id="fachoose-wechat_account_qrcode" class="btn btn-primary fachoose" data-input-id="c-wechat_account_qrcode" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
												</div>
												<span class="msg-box n-right" for="c-wechat_account_qrcode"></span>
											</div>
											<ul class="row list-inline faupload-preview" id="p-wechat_account_qrcode"></ul>
										</div>
										<div class="col-sm-4"></div>
									</div>
								</td>
							</tr>

                        </tbody>
                    </table>
                    <div class="form-group layer-footer">
                        <label class="control-label col-xs-12 col-sm-2"></label>
                        <div class="col-xs-12 col-sm-8">
                            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
                            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</form>

<script>

    require.callback = function () {
        var tabevent = function () {
            $(document).on("click", ".nav-group li a[data-toggle='tab']", function () {
                var type = $(this).attr("href").substring(1);
                if (type == 'all') {
                    $(".table-config tr").show();
                } else {
                    $(".table-config tr").hide();
                    $(".table-config tr[data-type='" + type + "']").show();
                }
            });
        };


		define('backend/configs', ['jquery', 'form'], function ($, Form) {
            var Controller = {
                index: function () {
                    Form.api.bindevent($("form[role=form]"));
                    tabevent();
                }
            };
            return Controller;
        });

    }

	/**
	require.callback = function () {

		var tabevent = function () {
			$(document).on("click", ".nav-group li a[data-toggle='tab']", function () {
				var type = $(this).attr("href").substring(1);
				if (type == 'all') {
					$(".table-config tr").show();
				} else {
					$(".table-config tr").hide();
					$(".table-config tr[data-type='" + type + "']").show();
				}
			});
		};

		define('backend/vppz/config', ['jquery', 'form'], function ($, Form) {
			var Controller = {
				index: function () {
					Form.api.bindevent($("form[role=form]"));
					tabevent();
				}
			};
			return Controller;
		});
	}
	**/


</script>
